support session listing and loading#263
Conversation
83b5b72 to
211254e
Compare
|
Sorry for the delay. We have an existing PR for session loading in #248 (cc @farra). I need to spend some time comparing the two approaches to figure out how to move forward. Relatedly, I'm considering a non-comint buffer alternative which may simplify handshake for us (and possibly loading sessions). I need to play with both implementations quite a bit. It's gonna take me a little while, sorry. |
|
@travisjeffery @farra looks like we'll be able to merge bits from both PRs and we get both loading (for Codex) and resume (for Claude Code). I'll share a branch soon so you both can try it out. |
|
@travisjeffery I noticed you implemented session deletion b1e94fe. I've not been able to try it out. Doesn't seem to be available in neither codex nor claude code? I've updated agents and acp counterparts. Here's what my codex-acp reports: ▼ Agent capabilities load session Could you share details on your setup please? |
| (acp-send-request | ||
| :client (map-elt (agent-shell--state) :client) | ||
| :request `((:method . "session/list") | ||
| (:params . ((cwd . ,(agent-shell--resolve-path (agent-shell-cwd))))))) |
There was a problem hiding this comment.
We have a misplaced paren at the end of this line.
Here's the branch: https://github.com/xenodium/agent-shell/tree/pr263-resume-session It's got changes from #263 rebased onto main. To try this branch out, you'll need the latest acp.el, including this commit xenodium/acp.el@e5dec95 With the main rebase, we no longer need to defer initialization until after sending a prompt. This improves the loading session flow on shell startup. To try things out, you'll need these settings: (setq agent-shell-deferred-initialization nil)
(setq agent-shell-session-load-strategy 'prompt)You can then use |
|
ps. I've yet to try deletion out as per #263 (comment), so I can't confirm this flow just yet. |
Yeah it's still early and not well supported it seems like: https://agentclientprotocol.com/rfds/session-delete -- I put it in now so that I could clear out sessions from showing in the list. Later it'd be nice if whatever ACP you were running supported the call. |
I'm trying the branch, it maintains same flow I had. The deferred init is nice. 👍 The other feature I wanted to look into was making Codex' collab mode available. |
Yep. The two flows work well together. Are you happy for me to continue cleaning up the branch and move forward from there to get things merged? I'll squash the branch commits and credit both you and @farra, if that's ok.
Separate PR please. Also could you file a feature request and describe the feature a bit before making the PR?
Makes sense. I'll remove deletion from the branch for the time being. When we are able to validate the feature, we can apply the changes again. |
Yep sounds good to me. |
@travisjeffery @farra give the latest in branch a try. Been working on polishing this part of the flow. |
Summary
This PR improves ACP session startup behavior and session selection UX.
It adds strategy-based session loading (
latest,prompt,new), supports loading existing sessions when the agent advertisessession/list+session/load(codex-acp for example), and has ** Start a new session ** as default.What Changed
agent-shell-session-load-strategy(latestdefault,prompt,new).session/list.session/load.new, attemptsession/listthensession/load.session/newon list/load errors or when no session is selected.title | updatedAt | sessionId).Tests
Added/updated ERT coverage for:
session/newwhensession/listfails.newstrategy bypassing list/load.Targeted test run for these flows passes.
Docs / Follow-up Included in Branch
This branch also includes small documentation updates:
agent-shell.el.agent-shell-session-load-strategy.Checklist
M-x checkdocandM-x byte-compile-file.